{
  "$schema" : "http://json-schema.org/draft/2019-09/schema#",
  "title" : "Recurring Pre Payments Balance",
  "type" : "object",
  "additionalProperties" : false,
  "properties" : {
    "jobCode" : {
      "type" : "string",
      "maxLength" : 20,
      "description" : "Unique identfier of the CMP job that produces this extract file."
    },
    "jobDescription" : {
      "type" : "string",
      "description" : "A short description of the CMP job that produces this extract file."
    },
    "interfaceCategory" : {
      "type" : "string",
      "maxLength" : 20,
      "enum" : [ "Payments" ],
      "description" : "CMP categorization of the job that produces this extract file."
    },
    "interfaceType" : {
      "type" : "string",
      "maxLength" : 24,
      "enum" : [ "Balance Pre Payments" ],
      "description" : "CMP sub-categorization of the job that produces this extract file."
    },
    "version" : {
      "type" : "number",
      "minimum" : 1.0,
      "maximum" : 1.0,
      "description" : "The current version of the generic extract file. This must match the corresponding inbound file."
    },
    "batchDateTime" : {
      "type" : "string",
      "format" : "date-time",
      "description" : "Timestamp indicating when the batch was created in CMP."
    },
    "extractDateTime" : {
      "type" : "string",
      "format" : "date-time",
      "description" : "Timestamp indicating when the generic extract file was created."
    },
    "extractUpToDate" : {
      "type" : "string",
      "format" : "date-time",
      "description" : " Only payments due on or before this date are included in the extract file."
    },
    "recordCount" : {
      "type" : "integer",
      "minimum" : 0,
      "description" : "Total number of transaction records in the extract file."
    },
    "paymentTotal" : {
      "type" : "number",
      "minimum" : 0.0,
      "maximum" : 9.9999999999E8,
      "description" : "Total value of payment transactions in the extract file."
    },
    "details" : {
      "type" : "array",
      "items" : {
        "$ref" : "#/definitions/RecurringPrePaymentsBalanceDetail"
      }
    },
    "id" : {
      "type" : "integer",
      "description" : "Unique identifier for each generic extract file that is produced by CMP."
    }
  },
  "required" : [ "version", "recordCount", "paymentTotal", "id" ],
  "definitions" : {
    "RecurringPrePaymentsBalanceDetail" : {
      "type" : "object",
      "additionalProperties" : false,
      "properties" : {
        "detailSequence" : {
          "type" : "integer",
          "description" : "Unique identifier of the detail record within the file"
        },
        "subscriptionNumber" : {
          "type" : "integer",
          "minimum" : 1,
          "maximum" : 99999999,
          "description" : "The unique identifier of the subscriptionNumber in CMP."
        },
        "amount" : {
          "type" : "number",
          "minimum" : 0.0,
          "maximum" : 9.9999999999E8,
          "description" : "Amount of the payment or refund"
        },
        "transactionNumber" : {
          "type" : "integer",
          "minimum" : 1,
          "maximum" : 99999999,
          "description" : "Unique identifier of the payment/refund transaction. This should be included in requests that are sent to third-party systems"
        },
        "balanceName" : {
          "type" : "string",
          "maxLength" : 30,
          "description" : "Name of balance that is being debited on the OCS"
        },
        "serialNumber" : {
          "type" : "string",
          "minLength" : 1,
          "maxLength" : 25,
          "description" : "Serial number for the subscription."
        }
      },
      "required" : [ "subscriptionNumber", "amount" ]
    }
  }
}